<?php
/**
 * Created by PhpStorm.
 * Admin: Administrator
 * Date: 2018/7/28/028
 * Time: 18:10
 */


namespace App\Http\Controllers\Custom;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use App\Http\Service\OnlineTeam\TeamService;
use Session,Config;
use Cache;
use Excel;

class CustomServiceController extends Controller
{
    /**
     * @return view
     * 客服日志页面
     */
    public function index()
    {
        return view('Service.service_log');
    }


    /**
     * @param Request $request
     * 客服日志列表
     */
    public function getSeviceLogList(Request $request)
    {

        $where= $request->except('_token');

        if($request->has('page'))
        {
            $where['page_no'] = $request->input('page');
            unset($where['page']);
        }
        if($request->has('limit'))
        {
            $where['page_size'] = $request->input('limit');
            unset($where['limit']);
        }else{
            $where['page_size'] = 10;
        }


        foreach($where as $key=>$value)
        {
            if($value =='' || $value == 'undefined')
            {
                unset($where[$key]);
            }
        }

        $user = new TeamService();
        $data = $user->getOnlineTeamLogList($where);

        if($data && !empty($data['data']))
        {
            return $data;

        }


    }

}